package com.rr.hippo4jdemo.controller;

import com.rr.hippo4jdemo.service.DynamicSyncService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author RR
 * @date 2024/7/20 21:36
 */
@RestController
@RequiredArgsConstructor
public class DynamicSyncController {
    private final DynamicSyncService dynamicSyncService;

    @GetMapping("/invoke/{times}")
    public String invoke(@PathVariable("times") Integer times) {
        for (int i = 0; i < times; i++) {
            dynamicSyncService.doSync();
        }
        return "ok";
    }
}
